((typeof self !== 'undefined' ? self : this)["webpackJsonppage_engine"] = (typeof self !== 'undefined' ? self : this)["webpackJsonppage_engine"] || []).push([[14],{

/***/ "3509":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3712dab3-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./client/components/monaco/monaco.vue?vue&type=template&id=a097a21e&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"monaco"},[_c('div',{ref:_vm.id,style:({ height: _vm.height + 'px' })})])}
var staticRenderFns = []


// CONCATENATED MODULE: ./client/components/monaco/monaco.vue?vue&type=template&id=a097a21e&

// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.number.constructor.js
var es6_number_constructor = __webpack_require__("c5f6");

// EXTERNAL MODULE: include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.main.js
var editor_main = __webpack_require__("c2c6");

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./client/components/monaco/monaco.vue?vue&type=script&lang=js&

//
//
//
//
//
//

/* harmony default export */ var monacovue_type_script_lang_js_ = ({
  name: 'Monaco',
  mounted: function mounted() {
    var _this = this;

    this.initMonaco();
    this.$bus.$on('createMonacoInstance', function () {
      _this.initMonaco();
    });
    this.$bus.$on('setLanguage', function (language) {
      if (_this.$monacoInstance) {
        var model = _this.$monacoInstance.getModel();

        if (model && model.uri) {
          editor_main["editor"].setModelLanguage(model, language);
        }
      }
    });
  },
  props: {
    value: {
      type: String,
      default: ''
    },
    height: {
      type: Number,
      default: 300
    },
    language: {
      type: String,
      default: 'json'
    },
    readOnly: {
      type: Boolean,
      default: true
    },
    id: {
      type: String,
      default: 'monaco'
    }
  },
  watch: {
    value: function value(val) {
      if (val) {
        if (this.$monacoInstance) {
          this.$monacoInstance.getModel().setValue(val);
        }
      }
    }
  },
  methods: {
    initMonaco: function initMonaco() {
      var that = this;

      if (that.$refs && that.$refs[that.id]) {
        if (that.$monacoInstance) {
          that.$monacoInstance.dispose();
        }

        that.$monacoInstance = editor_main["editor"].create(that.$refs[that.id], {
          value: that.addBackspace(that.value),
          language: that.language,
          theme: 'hc-black',
          automaticLayout: true,
          readOnly: that.readOnly,
          wordWrap: 'on',
          folding: true,
          contextmenu: 'false',
          layoutInfo: {
            height: 300,
            width: 200
          }
        });
        that.$monacoInstance.onDidBlurEditorText(function () {
          if (that.$monacoInstance) {
            var val = that.$monacoInstance.getModel().getValue();
            that.$emit('blur', val);
          }
        });
      }
    },
    addBackspace: function addBackspace(result) {
      if (this.language === 'json') {
        return result;
      } else {
        return result;
      }
    }
  },
  beforeDestroy: function beforeDestroy() {
    if (this.$monacoInstance) {
      this.$monacoInstance.dispose();
    }
  }
});
// CONCATENATED MODULE: ./client/components/monaco/monaco.vue?vue&type=script&lang=js&
 /* harmony default export */ var monaco_monacovue_type_script_lang_js_ = (monacovue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./client/components/monaco/monaco.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  monaco_monacovue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var monaco = __webpack_exports__["a"] = (component.exports);

/***/ }),

/***/ "9814":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3712dab3-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./client/pages/js/interview.vue?vue&type=template&id=e3b54cb4&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-tabs',{on:{"tab-click":_vm.handleClick}},[_c('el-tab-pane',{attrs:{"label":"统计网页中的标签"}},[_c('monaco',{attrs:{"id":"allpLabel","value":_vm.allpLabel,"language":"javascript","readOnly":false,"height":600}})],1),_c('el-tab-pane',{attrs:{"label":"js深拷贝"}},[_c('monaco',{attrs:{"id":"deepCopy","value":_vm.deepCopy,"language":"javascript","readOnly":false,"height":600}})],1),_c('el-tab-pane',{attrs:{"label":"原生ajax"}},[_c('monaco',{attrs:{"id":"ajax","value":_vm.ajax,"language":"javascript","readOnly":false,"height":600}})],1),_c('el-tab-pane',{attrs:{"label":"防抖和节流"}},[_c('monaco',{attrs:{"id":"shake","value":_vm.shake,"language":"javascript","readOnly":false,"height":600}})],1),_c('el-tab-pane',{attrs:{"label":"解析URL参数"}},[_c('monaco',{attrs:{"id":"parseUrl","value":_vm.parseUrl,"language":"javascript","readOnly":false,"height":600}})],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./client/pages/js/interview.vue?vue&type=template&id=e3b54cb4&

// EXTERNAL MODULE: ./client/components/monaco/monaco.vue + 4 modules
var monaco = __webpack_require__("3509");

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./client/pages/js/interview.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ var interviewvue_type_script_lang_js_ = ({
  data: function data() {
    return {
      allpLabel: "new Set([...document.querySelectorAll('*')].map(ele=>ele.tagName)).size",
      deepCopy: "function deepClone(obj)\n            {\n                    if(obj === null) return null\n                    if(typeof obj !=='object') return obj\n                    if(typeof window !== 'undefined' && window.JSON){\n                        return JSON.parse(JSON.stringify(obj))\n                    }\n\n                    if(obj instanceof RegExp){\n                        return new RegExp(obj)\n                    }\n\n                    if(obj instanceof Date){\n                        return new Date(obj)\n                    }\n                    let newObj = new obj.construtor\n                    for(let key in obj){\n                        if(obj.hasOwnProperty(key)){\n                            newObj[key] = deepClone(obj[key])\n                        }\n                    }\n                    return newObj\n            }",
      ajax: "funciton ajax(options){\n                let method = options.method || 'get',\n                    params = options.params,\n                    data = options.data,\n                    url = options.url + (params ? '?' + Object.keys(params).map(key => key + '=' + params[key] : ''\n                    async = options.async === false ? false : true,\n                    success = options.success,\n                    headers = options.headers\n                    \n                let xhr\n                if(window.XMLHttpRequest){\n                    xhr = new XMLHttpRequest()\n                } else {\n                    xhr = new ActiveXObject('Microsoft.XMLHTTP')\n                }\n                \n                xhr.onreadystatechange = function(){\n                    if(xhr.readyState === 4 && xhr.status === 200){\n                        success && success(xhr.responseText)\n                    }\n                }\n                \n                xhr.open(method, url, async)\n                \n                if(headers){\n                    Object.keys(Headers).forEach(key => xhr.setRequestHeader(key, headers[key]))\n                }\n                \n                method === 'GET' ? xhr.send() : xhr.send(data)\n            }",
      shake: "const debounce = (fn, delay) => {\n                    let timer = null\n                    return (...args) => {\n                        clearTimeout(timer)\n                        timer = setTimeout(() => {\n                            fn.apply(this, args)\n                        }, delay)\n                    }\n                }\n                const throttle = (fn, delay = 500) => {\n                    let prev = Date.now()\n                    return (...args) => {\n                        let now = Date.now()\n                        if(now - prev > delay){\n                            fn.apply(this, args)\n                            prev = Date.now()\n                        }\n                    }\n                }\n                ",
      parseUrl: "function parseParam(url){\n                // \u5C06\u6D4F\u89C8\u5668\u5730\u5740\u4E2D'?' \u540E\u9762\u7684\u5B57\u7B26\u4E32\u53D6\u51FA\u6765\n                const paramsStr = /.+?(.+)$/.exec(url)[1]\n                // \u5C06\u622A\u53D6\u7684\u5B57\u7B26\u4E32\u4EE5'&'\u5206\u9694\u540E\u5B58\u5230\u6570\u7EC4\u4E2D\n                const paramsArr = paramsStr.split('&')\n                // \u5B9A\u4E49\u5B58\u653E\u89E3\u6790\u540E\u7684\u5BF9\u8C61\n                let parmsObj = {}\n                // \u904D\u5386\n                paramsArr.forEach(param => {\n                    // \u5224\u65AD\u662F\u5426\u542B\u6709key\u548Cvalue\n                    if(/=/.test(param)){\n                        // \u7ED3\u6784\u83B7\u53D6\u5BF9\u8C61\u7684key\u548Cvalue\n                        let [key, val] = param.split('=')\n                        // \u89E3\u7801\n                        val = decodeURIComponent(val)\n                        // \u5224\u65AD\u662F\u5426\u8F6C\u4E3A\u6570\u5B57\n                        val = /^d+$/.test(val) ? parseFloat(val) : val\n                        // \u5224\u65AD\u5B58\u653E\u5BF9\u8C61\u4E2D\u662F\u5426\u5B58\u5728key\u5C5E\u6027\n                        if(paramsObj.hasOwnProperty(key)){\n                            // \u5B58\u5728\u7684\u8BDD\u5C31\u5B58\u653E\u4E00\u4E2A\u6570\u7EC4\n                            paramsObj[key] = [].concat(paramsObj[key], val)\n                        } else {\n                            // \u4E0D\u5B58\u5728\u5C31\u5B58\u653E\u4E00\u4E2A\u5BF9\u8C61\n                            paramsObj[key] = val\n                        }\n                    } else {\n                        // \u4E0D\u5B58\u5728\u5C31\u5B58\u653E\u4E00\u4E2A\u5BF9\u8C61\n                        paramsObj[key] = val\n                    }\n                } else {\n                    // \u6CA1\u6709value\u7684\u60C5\u51B5\n                    paramsObj[param] = true       \n                }\n              })\n              return paramsObj\n            }\n            "
    };
  },
  mounted: function mounted() {
    this.$bus.$emit("createMonacoInstance");
  },
  methods: {
    handleClick: function handleClick() {
      this.$bus.$emit("createMonacoInstance");
    }
  },
  components: {
    Monaco: monaco["a" /* default */]
  }
});
// CONCATENATED MODULE: ./client/pages/js/interview.vue?vue&type=script&lang=js&
 /* harmony default export */ var js_interviewvue_type_script_lang_js_ = (interviewvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./client/pages/js/interview.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  js_interviewvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var interview = __webpack_exports__["default"] = (component.exports);

/***/ })

}]);